package a.f.g.a;

import a.c.e;
import a.c.k;
import a.c.m;
import a.c.w;
import a.c.x;
import a.d.u;
import a.f.c.h;
import a.f.c.i;
import a.f.o;
import a.i.q;

import java.util.ArrayList;

class kb
  implements bc
{
  private final d a;
  private x b;
  private b_ c;
  
  kb(d paramd)
  {
    this.a = paramd;
  }
  
  private k a(o paramo)
  {
    k localk = paramo.c(t.a);
    if (!xb.r) {
      if (localk == null) {
        localk = q.a(Boolean.TRUE);
      }
    }
    return localk;
  }
  
  public void a(bb parambb, xb paramxb)
  {
    boolean bool = xb.r;
    int m = xb.q;
    o localo = paramxb.m();
    if (!bool) {
      if (h.c(localo)) {
        return;
      }
    }
    k localk1 = localo.c(i.d);
    this.b = localo.B();
    h localh = new h(localo);
    x localx1 = localo.B();
    x localx2 = localo.B();
    ArrayList localArrayList1 = new ArrayList();
    u localu1 = new u(5.0D, 5.0D, 5.0D, 5.0D);
    k localk2 = a(localo);
    int i = 0;
    Object localObject1 = localo.v();
    Object localObject2;
    Object localObject3;
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      localObject2 = ((w)localObject1).d();
      if (m != 0) {
        break label519;
      }
      if (localh.e((e)localObject2))
      {
        if (bool) {
          continue;
        }
        if (localk2.getBool(localObject2))
        {
          i++;
          localObject3 = localu1;
          if ((bool) || (localk1 != null))
          {
            u localu2 = u.a(localk1.get(localObject2));
            if ((bool) || (localu2 != null)) {
              localObject3 = localu2;
            }
          }
          double d1 = localo.p((e)localObject2) + ((u)localObject3).c;
          double d2 = localo.q((e)localObject2) + ((u)localObject3).b;
          double d3 = localo.s((e)localObject2) - ((u)localObject3).c - ((u)localObject3).e;
          double d5 = localo.t((e)localObject2) - ((u)localObject3).b - ((u)localObject3).d;
          double d7 = Math.min(d3, d5) / 10.0D;
          ob localob1 = new ob(new yb(d1, d2, d3, d5, d7), ob.e, 0.0D, 1.0D);
          localob1.c(10.0D);
          ArrayList localArrayList2 = new ArrayList(1);
          localArrayList2.add(localob1);
          localx1.a(localObject2, localArrayList2);
          ob localob2 = new ob(new a_(localo.p((e)localObject2) - d7, localo.q((e)localObject2) - d7, localo.s((e)localObject2) + 2.0D * d7, localo.t((e)localObject2) + 2.0D * d7, d7), ob.b, 0.0D, 1.0D);
          localob2.a(ob.k);
          localob2.c(10.0D);
          if (!bool)
          {
            if (localh.b((e)localObject2) == localh.d()) {
              localArrayList1.add(localob2);
            }
            localx2.a(localObject2, localob2);
            paramxb.d((e)localObject2).f(1.0D);
          }
          paramxb.d((e)localObject2).a(true);
        }
      }
      ((w)localObject1).f();
    } while (m == 0);
    label519:
    label674:
    label683:
    if ((!bool) && (i > 0))
    {
      localObject1 = localo.v();
      label595:
      label629:
      do
      {
        do
        {
          if (!((w)localObject1).e()) {
            break label686;
          }
          break label595;
          localObject2 = ((w)localObject1).d();
          if (m != 0) {
            break label693;
          }
          if (!localh.e((e)localObject2)) {
            break label674;
          }
          if (bool) {
            break label683;
          }
          if (!localk2.getBool(localObject2)) {
            break label674;
          }
          localObject3 = localh.b((e)localObject2);
          do
          {
            if (localObject3 == localh.d()) {
              break label629;
            }
            if (m != 0) {
              break;
            }
            if (localk2.getBool(localObject3)) {
              break label629;
            }
            localObject3 = localh.b((e)localObject3);
          } while (m == 0);
          if (bool) {
            break;
          }
        } while (bool);
        if (localObject3 != localh.d()) {
          ((ArrayList)localx1.get(localObject3)).add(localx2.get(localObject2));
        }
        ((w)localObject1).f();
      } while (m == 0);
    }
    label686:
    if (!bool)
    {
      if (i > 0)
      {
        label693:
        localObject1 = localo.v();
        e locale1;
        label819:
        label886:
        do
        {
          do
          {
            if (!((w)localObject1).e()) {
              break label889;
            }
            break label785;
            localObject2 = ((w)localObject1).d();
            localObject3 = paramxb.d((e)localObject2);
            if ((!bool) && (m != 0)) {
              return;
            }
            if ((bool) || (((xb.a_)localObject3).q()))
            {
              if (bool) {
                break label886;
              }
              if (localk2.getBool(localObject2)) {
                break;
              }
            }
            locale1 = localh.b((e)localObject2);
            do
            {
              if (locale1 == localh.d()) {
                break label819;
              }
              if (m != 0) {
                break;
              }
              if (localk2.getBool(locale1)) {
                break label819;
              }
              locale1 = localh.b(locale1);
            } while (m == 0);
          } while (bool);
          if (locale1 != localh.d())
          {
            this.b.a(localObject2, localx1.get(locale1));
            if (bool) {
              continue;
            }
            if (m == 0) {}
          }
          else
          {
            this.b.a(localObject2, localArrayList1);
          }
          ((w)localObject1).f();
        } while (m == 0);
        label889:
        if (!bool)
        {
          localObject1 = localo.w();
          label1149:
          do
          {
            if (!((m)localObject1).e()) {
              break;
            }
            localObject2 = ((m)localObject1).a();
            if (m != 0) {
              break label1364;
            }
            if (!bool)
            {
              if (!localh.a((a.c.d)localObject2))
              {
                localObject3 = ((a.c.d)localObject2).e();
                locale1 = ((a.c.d)localObject2).f();
                e locale2 = localh.b((e)localObject3);
                e locale3 = localh.b(locale1);
                if (locale2 != localh.d()) {
                  if (bool) {}
                }
                int j = localk2.getBool(locale2) ? 1 : 0;
                if (locale3 != localh.d()) {
                  if (bool) {}
                }
                int k = localk2.getBool(locale3) ? 1 : 0;
                double d4;
                double d6;
                double d8;
                if (!bool) {
                  if (j != 0)
                  {
                    if (bool) {
                      break label1149;
                    }
                    if ((k != 0) && (locale3 != locale2))
                    {
                      d4 = localo.m(locale2);
                      d6 = localo.n(locale2);
                      d8 = localo.m(locale3);
                      double d9 = localo.n(locale3);
                      double d10 = Math.sqrt((d8 - d4) * (d8 - d4) + (d9 - d6) * (d9 - d6));
                      paramxb.c((a.c.d)localObject2).a(d10);
                      if (bool) {
                        continue;
                      }
                      if (m == 0) {
                        break label1307;
                      }
                    }
                  }
                }
                if (k != 0)
                {
                  if (bool) {
                    break label1239;
                  }
                  if (locale2 == localh.d())
                  {
                    d4 = localo.s(locale3) / 2.0D;
                    d6 = localo.t(locale3) / 2.0D;
                    d8 = Math.sqrt(d4 * d4 + d6 * d6);
                    paramxb.c((a.c.d)localObject2).a(d8 * 0.3D);
                    if (bool) {
                      continue;
                    }
                  }
                }
                if ((m != 0) && (locale3 == localh.d()))
                {
                  if (bool) {
                    continue;
                  }
                  if (j != 0)
                  {
                    d4 = localo.s(locale2) / 2.0D;
                    d6 = localo.t(locale2) / 2.0D;
                    d8 = Math.sqrt(d4 * d4 + d6 * d6);
                    paramxb.c((a.c.d)localObject2).a(d8 * 0.3D);
                  }
                }
              }
              ((m)localObject1).f();
            }
          } while (m == 0);
          this.c = new b_(this.b);
          if (!bool) {
            this.a.a(this.c);
          }
        }
      }
      else
      {
        label1239:
        localo.a(localx1);
        localo.a(localx2);
      }
    }
    else {
      label1364:
      localh.e();
    }
    label785:
    label1307:
    return;
  }
  
  void a(xb paramxb)
  {
    boolean bool = xb.r;
    if (!bool) {
      if (this.b != null)
      {
        paramxb.m().a(this.b);
        this.b = null;
      }
    }
    if (!bool)
    {
      if (this.c != null) {
        this.a.c(this.c);
      }
    }
    else {
      this.c = null;
    }
  }
  
  static class a_
    implements nc
  {
    private double b = 50.0D;
    private double c;
    private double d;
    private double e;
    private double f;
    private double g = this.e + this.c / 2.0D;
    private double h = this.f + this.d / 2.0D;
    
    public void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      this.e = paramDouble1;
      this.f = paramDouble2;
      this.c = paramDouble3;
      this.d = paramDouble4;
      this.g = (this.e + this.c / 2.0D);
      this.h = (this.f + this.d / 2.0D);
    }
    
    public double a()
    {
      return this.b;
    }
    
    public void a(double paramDouble)
    {
      this.b = paramDouble;
    }
    
    public double b()
    {
      return this.d;
    }
    
    public void b(double paramDouble)
    {
      this.d = paramDouble;
      this.h = ((this.f + paramDouble) / 2.0D);
    }
    
    public double c()
    {
      return this.c;
    }
    
    public void c(double paramDouble)
    {
      this.c = paramDouble;
      this.g = (this.e + paramDouble / 2.0D);
    }
    
    public double d()
    {
      return this.e;
    }
    
    public void d(double paramDouble)
    {
      this.e = paramDouble;
      this.g = (paramDouble + this.c / 2.0D);
    }
    
    public double e()
    {
      return this.f;
    }
    
    public void e(double paramDouble)
    {
      this.f = paramDouble;
      this.h = ((paramDouble + this.d) / 2.0D);
    }
    
    public a_() {}
    
    public a_(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5)
    {
      a(paramDouble1, paramDouble2, paramDouble3, paramDouble4);
      this.b = paramDouble5;
    }
    
    public y a(cb paramcb, bb parambb, f paramf)
    {
      boolean bool = xb.r;
      y localy = paramcb.a();
      if (!bool)
      {
        if (this.c > 0.0D) {
          if (bool) {
            break label55;
          }
        }
      }
      else {
        if (this.d > 0.0D) {
          break label43;
        }
      }
      return paramf;
      label43:
      label55:
      double d1 = this.c - 2.0D * this.b;
      double d2 = this.d - 2.0D * this.b;
      double d3 = localy.d() - this.g - paramcb.l();
      double d4 = localy.f() - this.h - paramcb.l();
      if (!bool)
      {
        if (Math.abs(d3) <= this.c / 2.0D)
        {
          if (bool) {
            break label184;
          }
          if (Math.abs(d4) <= this.d / 2.0D) {}
        }
        else
        {
          paramf.a();
        }
      }
      else {
        return paramf;
      }
      if (!bool) {
        if (Math.abs(d3) <= d1 / 2.0D)
        {
          label184:
          if (bool) {
            break label227;
          }
          if (Math.abs(d4) <= d2 / 2.0D)
          {
            paramf.b(d3, d4, 0.0D);
            paramf.b();
            return paramf;
          }
        }
      }
      label227:
      double d5 = 0.0D;
      double d6 = 0.0D;
      if (!bool) {
        if (d3 > d1 / 2.0D)
        {
          d5 = this.c / 2.0D - d3;
          if (bool) {
            break label377;
          }
          if (Math.abs(d4) > d2 / 2.0D) {
            break label368;
          }
          paramf.b(d5 / this.b, 0.0D, 0.0D);
          return paramf;
        }
      }
      if (!bool) {
        if (d3 < -d1 / 2.0D)
        {
          d5 = -this.c / 2.0D - d3;
          if (bool) {
            break label377;
          }
          if (Math.abs(d4) <= d2 / 2.0D)
          {
            paramf.b(d5 / this.b, 0.0D, 0.0D);
            return paramf;
          }
        }
      }
      label368:
      label377:
      if (!bool)
      {
        if (d4 > d2 / 2.0D)
        {
          d6 = this.d / 2.0D - d4;
          if (bool) {
            break label513;
          }
          if (Math.abs(d3) <= d1 / 2.0D)
          {
            paramf.b(0.0D, d6 / this.b, 0.0D);
            return paramf;
          }
        }
        else
        {
          if (bool) {
            break label513;
          }
        }
      }
      else if (d4 < -d2 / 2.0D)
      {
        d6 = -this.d / 2.0D - d4;
        if (bool) {
          break label513;
        }
        if (Math.abs(d3) <= d1 / 2.0D)
        {
          paramf.b(0.0D, d6 / this.b, 0.0D);
          return paramf;
        }
      }
      label513:
      double d7 = this.b - Math.abs(d5);
      double d8 = this.b - Math.abs(d6);
      double d9 = Math.sqrt(d7 * d7 + d8 * d8);
      if (!bool) {
        if (d9 > this.b)
        {
          paramf.a();
          return paramf;
        }
      }
      double d10 = 1.0D - d9 / this.b;
      paramf.b(d5, d6, 0.0D);
      paramf.b();
      paramf.f(d10);
      return paramf;
    }
  }
  
  static class b_
    extends v
  {
    private k c;
    
    b_(k paramk)
    {
      this.c = paramk;
    }
    
    protected k a(o paramo)
    {
      return this.c;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.g.a.kb

 * JD-Core Version:    0.7.0.1

 */